GrafEq - Functions and Relations
Macintosh ManualAppendix B. Functions and Relations
Algebraic Functions
- Exponentiation includes a2, a3, and
the complete range of simple and
complex power functions. Each takes one base term, and one power term.
Hint: | Besides easy buttons, entry of exponentiation can also be initiated by pressing
the up arrow key or the caret key. |
|
- Radical includes sqrt, root(3,x), and the complete range of
simple and complex root functions. Each takes one root index term, and one radical term.
- Logarithm includes log (for base 10), lg (for base 2),
ln (for natural logarithm
or base e), and the complete range of simple and complex logarithm functions.
Each takes one base term, and argument term.
Hint: | Besides easy buttons, entry of logarithm base can also be initiated by pressing
the down arrow key. |
|
Arithmetic Operations
- Addition (+), Subtraction (-), and Add-and/or-Subtract (±) can
be either infix binary with the operator in between two argument terms,
or prefix unary with the operator in front of one argument term.
Hint:
Besides the easy button, the ± symbol can be entered with the
control-+ key combination.
- Multiplication (*) and Division (/ or ÷) are infix binary.
Hint:
Besides the easy button, the ÷ symbol can be entered with the
control-/ key combination.
Factoring Functions
- Modulo (mod) takes two argument terms, and returns the positive remainder of
the division of the first argument term by the second argument term.
- Least Common Multiple (lcm) and
Greatest Common Divisor (gcd) each
takes two or more argument terms, and are generalized to real valued arguments.
- Gamma (gamma) function is a continuous extension of the factorial function. For any
non-negative integer x, gamma(x+1) is equal to x!.
- Factorial (!) is postfix unary with the operator
following one argument term.
It is a recursively defined function: for any non-negative integer x,
(x+1)! returns (x+1)x!, and 0! returns 1.
Integer Functions
Integer functions convert real values to intergers. Each function takes one argument.
- Floor (⌊x⌋) returns the closest integer smaller than or
equal to the argument value.
Hint: | Besides the easy buttons, the floor symbols can be entered with the
control-[ and control-] key combinations. |
|
- Ceiling (⌈x⌉) returns the closest integer larger than or
equal to the argument value.
Hint: | Besides the easy buttons, the ceiling symbols can be entered with the
control-{ and control-} key combinations. |
|
- Round (Round) and round (round) returns the rounded or
closest interger from the argument value.
Round (with a capital ‘R’) rounds up, and
round (with a lowercase ‘r’) rounds down; which means that if
the argument value ends with ‘.5’, such as 4.5, Round would return 5 and
round would return 4.
- Trunc (trunc) returns the integer portion of the argument value, by deleting the
fractional part. It is the same as the floor function for positive argument values,
the same as the ceiling function for negative argument values.
Measure Functions/Magnitude Operators
- Absolute Value (|x|) takes one argument, and returns the value without the sign.
- Signum (signum) takes one argument, and returns -1 for a negative argument,
1 for a positive argument, and 0 for an argument that equals 0.
- Angle (angle) takes two arguments x and y,
and return the
angle between the point (x,y) and the x-axis.
Order Functions
- Minimum (min) and
Maximum (max) each takes two or more arguments,
and returns the smallest, and largest value respectively.
- xth minimum (minx) and xth maximum (maxx)
each takes a number of argument equal to or larger than the value of x, where
x is a positive integer. The xth smallest, and xth largest value respectively
would be returned.
Hint:
If x does not evaluate to an integer between 1 and the number of arguments,
both functions would be undefined.
Relational Functions
Relational functions includes Equal to (=), Less than (<),
Greater than (>)
and the complete range of positive and negative, simple and complex relations.
All relational functions are infix binary with the operator in between two terms.
Hint:
Besides easy buttons, less than or equal to can also be entered with the
control-< key combination; greater than or equal to
with the control-> key combination.
Set Functions
- Set element listings are to be enclosed within pairs of braces ({}),
with a comma (,) separating every two successive set elements.
- Set membership can be set with is member (e) and
is not member (e).
Hint:
Besides easy button, is member of can also be entered with the
control-= key combination.
- Conditional definitions are described within pairs of braces ({}),
with one or more sets of a value term followed by if (if), then the condition.
An example is: y={x if x>=0; -x if x<0}
Hint:
Pairs of braces, brackets, as well as parentheses can also be used to control precedence.
Trig Functions and Relations
All trig functions and relations take one argument each.
- Trig Functions include circular, hyperbolic, square, and diamond
functions.
- Circular trig functions are based on the circle, and
include sine (sin), cosine (cos), tangent (tan),
cosecant (csc), secant (sec), and cotangent (cot).
- Hyperbolic trig functions are based on the hyperbola, and
include the six functions of the circular ones, but with an appended “h”.
They are sinh, cosh, tanh,
csch, sech, and coth.
- Square trig functions are based on the square, and
include the six functions of the circular ones, but with an appended “q”.
They are sinq, cosq, tanq,
cscq, secq, and cotq.
- Diamond trig functions are based on the diamond parallelogram, and
include the six functions of the circular ones, but with an appended “d”.
They are sind, cosd, tand,
cscd, secd, and cotd.
- Inverse Trig Functions also include circular, hyperbolic, square, and diamond
functions. Each collection has the same trig functions, but with a preceding “Arc”.
They include Arcsin, Arccosd, and so on.
- Inverse Trig Relations also include circular, hyperbolic, square, and diamond
relations. Each collection has the same trig operations, but with a preceding “arc”.
They include arcsin, arccosd, and so on.
To conclude this section of the manual,
following are some additional hints and tips about
GrafEq functions, relations, and operations:
- Each argument or term can be a simple term or a complex term that can
contain any number of functions, operations, and values. Complex terms might need
to be enclosed in appropriate/necessary parentheses.
- Degree (°), Minute ('), and Second ('')
returns p/180, p/(180*60), and p/(180*60*60) respectively.
Hint:
5'33'' is interpreted
as the multiplication product of 5p/(180*60) and 33p/(180*60*60).
- Precedence of operations:
- Bracket-like operators, such as brackets, parenthesis, braces, floor,
ceiling, absolute value, and conditional/piecewise definition
- Postfix operators, such as factorial
- Exponentiation
- Multiplication and division
- Prefix operators, such as negation
- Addition and subtraction
- Comparisons, such as equal-to, less-then, and greater-then
- Precedence for function application is not clear cut.
For example, sin2x is parsed as sin(2x); multiplication has higher precedence than
the sine function. However, sinxcosx is parsed as (sinx)(cosx);
multiplication has higher precedence in sin2x, but has lower precedence in sinxcosx.
- The visual mathematics formating GrafEq’s algebraic window presents
often reflect whether a specification is entered correctly.
If in any doubt, parentheses or brackets can always be used.
Tip: The structural tree structured relation description is a new feature
introduced in GrafEq 2.04, and can be used for accurate confirmation.